package com.joker.product.remote;

import com.joker.common.core.constant.ServiceNameConstants;
import com.joker.common.core.domain.Result;
import com.joker.product.domain.Merchant;
import com.joker.product.domain.PmsSkuInfo;
import com.joker.product.remote.factory.PmsSkuInfoRemoteFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * @author lemon
 * @date 2024/12/29 15:07
 **/
@FeignClient(contextId = "remoteProductService", value = ServiceNameConstants.PRODUCT_SERVICE,fallbackFactory = PmsSkuInfoRemoteFallbackFactory.class)
public interface IPmsSkuInfoRemoteService {

    /**
     * 获取sku信息
     * @param skuId skuId
     * @return
     */
    @GetMapping(value = "/skuInfo/{skuId}")
    public Result<PmsSkuInfo> getInfo(@PathVariable("skuId") Long skuId);

    /**
     * 通过sku获取商户信息
     * @param skuId skuId
     * @return
     */
    @GetMapping(value = "/skuInfo/getMerchantBySkuId/{skuId}")
    public Result<Merchant> getMerchantBySkuId(@PathVariable("skuId") Long skuId);

    /**
     * 获取sku对应的销售属性
     * @param skuId skuId
     * @return
     */
    @GetMapping(value = "/skuInfo/getSaleAttrBySkuId/{skuId}")
    public Result<List<String>> getSaleAttrBySkuId(@PathVariable("skuId") Long skuId);
}
